home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # -*- coding: utf-8 -*-
- # Post-installation script for D-BUS
- # Copyright © 2003 Colin Walters <walters@debian.org>
- # Copyright © 2006 Sjoerd Simons <sjoerd@debian.org>
-
- set -e
-
- MESSAGEUSER=messagebus
- MESSAGEHOME=/var/run/dbus
-
-
- chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup --system "$MESSAGEUSER"
- chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
- adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
-
- # fix rc symlink priorities for upgrades from older versions
- if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.0.2-1ubuntu3; then
- echo "Fixing up startup script priorities..."
- for l in 2 3 4 5; do
- old=/etc/rc$l.d/S20dbus
- new=/etc/rc$l.d/S12dbus
- if [ -e $old ] && ! [ -e $new ]; then
- mv $old $new
- fi
- done
- fi
-
- # Do not restart dbus on upgrades, only on fresh installations
- # But do reload it so the machine-id can be generated
- if [ "$1" = "configure" ]; then
- if [ -e /var/run/dbus/pid ] &&
- ps --no-heading -p $(cat /var/run/dbus/pid) > /dev/null; then
- # trigger an update notification which recommends to reboot
- [ -x /usr/share/update-notifier/notify-reboot-required ] && \
- /usr/share/update-notifier/notify-reboot-required || true
- if [ -x "/etc/init.d/dbus" ]; then
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d dbus reload || true
- else
- /etc/init.d/dbus reload || true
- fi
- fi
- exit 0
- fi
- fi
-
- # Automatically added by dh_installinit
- if [ -x "/etc/init.d/dbus" ]; then
- update-rc.d dbus multiuser 12 20 >/dev/null
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d dbus start || exit $?
- else
- /etc/init.d/dbus start || exit $?
- fi
- fi
- # End automatically added section
-
-